package cn.tannn.surenessdemo.user.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * role entity
 * @author tan
 * @date 2022-07-18 10:29:46
 */
@Entity
@Table(name = "auth_role", indexes = {
        @Index(name = "code_name_index",columnList = "code,name", unique = true)
})
@org.hibernate.annotations.Table(appliesTo = "auth_role", comment = "角色表")
@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@DynamicInsert
public class AuthRole extends CommonBean<AuthRole> {

    /**
     * 角色名
     */
    @Column(columnDefinition = " varchar(50) not null comment '角色名' ")
    private String name;

    /**
     * 角色编码
     */
    @Column(columnDefinition = " varchar(50) not null comment '角色编码' ")
    private String code;

    /**
     * 角色状态： 1:启用、0：禁用
     */
    @Column(columnDefinition = " smallint default 1  comment '角色状态： 1:启用、0：禁用' ")
    private Integer status;

    /**
     * 角色描述
     */
    @Column(columnDefinition = " varchar(255) comment '角色描述' ")
    private String description;

}
